<%@page import="com.kaishengit.entity.CarItem"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
   <title>我的小小购物车</title>
  </head>
  
  <body>
  <a href="prod.jspx">继续购物</a>
  <%
  List<CarItem> list=(List<CarItem>)session.getAttribute("shopCar");
  %>
  <table  border="1" width="70%">
  	<tr>
  		<th>商品名称</th>
	  	<th>商品单价</th>
	  	<th>数量</th>
	  	<th>总价</th>
  	</tr>
  	<%
  	  float total=0f;
  	  if(list==null||list.isEmpty()){
  	%>
  	<tr>
  	<td colspan="4">购物车还是空的，快点<a href="prod.jspx">购物</a>吧!!</td>
  	
  	</tr>
  	   <% 
  	}else{
  		for(CarItem item:list){
  		total+=item.getTotal();
  	%>
  
  <tr>
  	<td><%=item.getProd().getProdName()%></td>
    <td><%=item.getProd().getPrice()%></td>
   
    
     <td><%=item.getNum() %></td> 
  	 <td>￥<%=item.getTotal()%></td>
  	<%} }%>
  </table>
  	<h3>共支付:￥<%=total%>元</h3>
  	<a href="order.jspx">结算</a> 
  
 
   </body>
</html>
